import React from 'react'
import { Consumer } from '../context'
import Sun from './sun'

export default class Son extends React.Component {
    render() {
        return <Consumer>
        {
            state => {
                return <div>
                    <h2>儿子</h2>
                    <button onClick={state.changeMsg('儿子改变的')}>儿子改变</button>
                    <Sun />
                </div>
            }
        }
    </Consumer>
    }
}